package cn.whuc.scala.collections

object Case01 {
  def main(args: Array[String]): Unit = {
    val array: Array[String] = Array("hadoop", "spark", "hive", "flume", "zookeeper")
    val list: List[String] = array.toList

    val map: Map[String, Int] = list.map(word => {
      (word, word.length)
    }).toMap

    val tuples: Seq[(String, Int)] = map.toSeq.sortBy(_._2)(Ordering.Int.reverse)

    println(tuples)

  }
}
